# -*- coding: utf-8 -*-
"""
Coroutines and concurrency/Tornado Locks/test02.py
"""
import asyncio
from tornado.locks import Event
from tornado import gen

event = Event()


async def worker():
    print("working...")
    await event.wait()
    print("work done off work.")


async def coordinator():
    print("Announcement to take a break.")
    event.set()
    print("End of notice.")


async def main():
    await gen.multi([
        worker(),
        coordinator()
    ])


if __name__ == '__main__':
    asyncio.run(main())
